<script setup lang="ts">
import { reactive } from "vue";
import { signin, userList } from "@/service/login";

const form = reactive({
  username: "",
  password: "",
});
const login = () => {
  console.log(form);
  signin(form).then(res => {
    console.log(res);
  });
};
const handleUserList = () => {
  userList().then(res => {
    console.log(res);
  });
  console.log("获取用户列表");
};
</script>

<template>
  <div>
    用户名：<input type="text" v-model="form.username" /><br />
    密码：<input type="text" v-model="form.password" /><br />
    <button @click="login">登录</button><br />
    <div>管理员账号：admin 123456</div>
    <div>测试账号：test 123456</div>
    <hr />
    <button @click="handleUserList">获取用户列表</button>
  </div>
</template>

<style scoped lang="scss"></style>
